package com.genius.util.Utils;

import com.genius.util.Utils.TestFunction.TestFunction;

public class TestMaster {
    private static void logMemory(){
        System.out.println("Total Memory:"+Runtime.getRuntime().totalMemory()/1048576+"Mb Free Memory:"+Runtime.getRuntime().freeMemory()/1048576+"Mb");
    }
    public static void logMemory(TestFunction testFunction){
        logMemory();
        testFunction.test();
        logMemory();
    }

    public static void logTime(TestFunction testFunction){
        long startTime = System.currentTimeMillis();
        try {
            testFunction.test();
        }catch (Exception e){
            e.printStackTrace();
        }
        long endTime = System.currentTimeMillis();
        System.out.println(" Time（ms） "+(endTime - startTime));
    }

}
